<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>人事信息管理管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#btnExport").click(function(){
				top.$.jBox.confirm("确认要导出用户数据吗？","系统提示",function(v,h,f){
					if(v=="ok"){
						$("#searchForm").attr("action","${ctx}/employee/employee/export");
						$("#searchForm").submit();
					}
				},{buttonsFocus:1});
				top.$('.jbox-body .jbox-icon').css('top','55px');
			});
			$("#btnImport").click(function(){
				$.jBox($("#importBox").html(), {title:"导入数据", buttons:{"关闭":true}, 
					bottomText:"导入文件不能超过5M，仅允许导入“xls”或“xlsx”格式文件！"});
			});
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<div id="importBox" class="hide">
		<form id="importForm" action="${ctx}/employee/employee/import" method="post" enctype="multipart/form-data"
			class="form-search" style="padding-left:20px;text-align:center;" onsubmit="loading('正在导入，请稍等...');"><br/>
			<input id="uploadFile" name="file" type="file" style="width:330px"/><br/><br/>　　
			<input id="btnImportSubmit" class="btn btn-primary" type="submit" value="   导    入   "/>
			<a href="${ctx}/employee/employee/import/template">下载模板</a>
		</form>
	</div>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/employee/employee/list">人事信息管理列表</a></li>
		<shiro:hasPermission name="employee:employee:edit"><li><a href="${ctx}/employee/employee/form">人事信息管理添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="employee" action="${ctx}/employee/employee/list" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>员工编号：</label>
				<form:input path="number" htmlEscape="false" maxlength="100" class="input-medium"/>
			</li>
			<li><label>员工姓名：</label>
				<form:input path="name" htmlEscape="false" maxlength="100" class="input-medium"/>
			</li>
			<li><label>国家：</label>
				<sys:treeselect id="company" name="company" value="${employee.company.id}" labelName="${employee.company.name}" labelValue="${employee.company.id}"
					title="国家" url="/sys/office/treeData?type=1" cssClass="input-small" allowClear="true" notAllowSelectParent="true"/>
			</li>
			<li><label>仓库：</label>
				<sys:treeselect id="office" name="office" value="${employee.office.id}" labelName="${employee.office.name}" labelValue="${employee.office.id}"
					title="仓库" url="/sys/office/treeData?type=2" cssClass="input-small" allowClear="true" notAllowSelectParent="true"/>
			</li>
			<!--  
			<li><label>部门：</label>
				<form:input path="department" htmlEscape="false" maxlength="100" class="input-medium"/>
			</li>
			-->
			<li><label>外包公司：</label>
			<form:select path="outsourcingCompany" class="input-medium">
				<form:option value="" label="请选择"/>
				<form:options items="${fns:getDictList('outsourcing_company_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
			</form:select>
				
			</li>
			<li><label>入职日期：</label>
				<input name="beginEntryDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
					value="<fmt:formatDate value="${employee.beginEntryDate}" pattern="yyyy-MM-dd"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/> - 
				<input name="endEntryDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
					value="<fmt:formatDate value="${employee.endEntryDate}" pattern="yyyy-MM-dd"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
			</li>
			<!--  
			<li><label>职位：</label>
				<form:input path="position" htmlEscape="false" maxlength="64" class="input-medium"/>
			</li>
			<li><label>职级：</label>
				<form:input path="rank" htmlEscape="false" maxlength="64" class="input-medium"/>
			</li>
			-->
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
				<input id="btnExport" class="btn btn-primary" type="button" value="导出"/>
				<input id="btnImport" class="btn btn-primary" type="button" value="导入"/>
			</li>	
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>员工编号</th>
				<th>员工姓名</th>
				<th>国家</th>
				<th>仓库</th>
				<th>部门</th>
				<th>员工类型</th>
				<th>外包公司</th>
				<th>入职日期</th>
				<th>职位</th>
				<th>职级</th>
				<th>时薪标准</th>
				<th>增值税率</th>
				<th>离职日期</th>
				<th>修改时间</th>
				<th>备注</th>
				<shiro:hasPermission name="employee:employee:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="employee">
			<tr>
				<td><a href="${ctx}/employee/employee/form?id=${employee.id}">
					${employee.number}
				</a></td>
				<td>
					${employee.name}
				</td>
				<td>
					${employee.company.name}
				</td>
				<td>
					${employee.office.name}
				</td>
				<td>
					${fns:getDictLabel(employee.department, 'department_type', '')}
				</td>
				<td>
					${fns:getDictLabel(employee.type, 'employee_type', '')}
				</td>
				<td>
					${fns:getDictLabel(employee.outsourcingCompany, 'outsourcing_company_type', '')}
				</td>
				<td>
					<fmt:formatDate value="${employee.entryDate}" pattern="yyyy-MM-dd"/>
				</td>
				<td>
					${fns:getDictLabel(employee.position, 'position_type', '')}
				</td>
				<td>
					${fns:getDictLabel(employee.rank, 'rank_type', '')}
				</td>
				<td>
					${employee.hourlyStandard}
				</td>
				<td>
					${employee.vatRate}
				</td>
				<td>
					<fmt:formatDate value="${employee.leaveDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					<fmt:formatDate value="${employee.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					${employee.remarks}
				</td>
				<shiro:hasPermission name="employee:employee:edit"><td>
    				<a href="${ctx}/employee/employee/form?id=${employee.id}">修改</a>
					<a href="${ctx}/employee/employee/delete?id=${employee.id}" onclick="return confirmx('确认要删除该人事信息管理吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>